package com.fqgj.sentry.policy.server;


import com.fqgj.sentry.policy.client.FunContextService;
import com.fqgj.sentry.policy.dao.PcFunctionContextDao;
import com.fqgj.sentry.policy.entity.PcFunctionContextEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by zwh @yuntu-inc.com
 *
 * @description
 * @create 2017/7/29 0029 上午 11:46
 */
@Service
public class FunContextServiceImpl implements FunContextService {
    @Autowired
    private PcFunctionContextDao functionContextDao;


    @Override
    public PcFunctionContextEntity save(PcFunctionContextEntity entity) {
        return functionContextDao.insert(entity);
    }

    @Override
    public Boolean update(PcFunctionContextEntity entity) {
        return functionContextDao.updateByPrimaryKey(entity) > 0;
    }

    @Override
    public PcFunctionContextEntity findByFunctionId(Long functionId) {
        return functionContextDao.findByFunctionId(functionId);
    }

    @Override
    public Boolean deleteByFunctionId(Long functionId) {
        return functionContextDao.deleteByFunctionId(functionId);
    }
}
